package com.hnkywl.sts.dao.sys;

import com.hnkywl.sts.entity.sys.Yjwzbm;
import com.hnkywl.sts.entity.sys.Ymys;
import net.ruixin.orm.hibernate.SimpleHibernateTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * User: ZHUCHG
 * Date: 13-5-7
 * Time: 下午9:44
 * To change this template use File | Settings | File Templates.
 */
@Repository
public class YmysDao extends SimpleHibernateTemplate<Ymys, Long> {

    public List<Ymys> findYmysByJsAndUrl(Set<Long> jsId, String url) {
        String hql = "select ymys from Qx qx left join qx.jsList js with js.id in (:jsid) left join qx.ymysList ymys with ymys.url=:url order by ymys.pxh";
        return createQuery(hql).setParameterList("jsid", jsId).setString("url", url).list();
    }
}
